<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/6/19
 * Time: 15:23
 */

namespace app\api\controller\v1;

use app\api\controller\Common;
use app\common\lib\exception\ApiException;

class Rank extends Common
{
    /**
     *  获取排行榜数据列表
     * 1、获取数据库 read_count 排序 5 - 10
     * 2、优化 redis
     */
    public function index(){
        try {
            $rands = model('News')->getTankNormalNews(5);
            $rands = $this->getDealNews($rands);
        }catch (\Exception $e){
            return new ApiException('error', 400);
        }
        return show(config('code.success'), 'OK', $rands, 200);
    }

}